package com.yuju.group.enums;

/**
 * 
 * 类名：GroupReturnCodeEnum  <br />
 *
 * 功能：部门业务代码枚举
 *
 * @author : zhousc <br />
 * @Date : 2017年11月23日 上午10:40:51  <br />
 * @version : 1.1 <br />
 */
public enum DepartmentReturnCodeEnum {
	DEPARTMENT_QUERY_SUCCESS("yuju-department-1000", "部门信息查询成功"),
	DEPARTMENT_QUERY_FAILURE("yuju-department-1001", "部门信息查询失败"),
	DEPARTMENT_SAVE_SUCCESS("yuju-department-1002", "部门信息保存成功"),
	DEPARTMENT_SAVE_FAILURE("yuju-department-1003", "部门信息保存失败"),
	DEPARTMENT_UPDATE_SUCCESS("yuju-department-1004", "部门信息更新成功"),
	DEPARTMENT_UPDATE_FAILURE("yuju-department-1005", "部门信息更新失败"),
	DEPARTMENT_DEL_SUCCESS("yuju-department-1006", "部门信息删除成功"),
	DEPARTMENT_DEL_FAILURE("yuju-department-1007", "该部门下有员工存在，不可删除"),
	DEPARTMENT_VALID_SUCCESS("yuju-department-1008", "检验成功"),
	DEPARTMENT_VALID_FAILURE("yuju-department-1009", "检验失败");
	
	private String code;
	private String desc;
	
	DepartmentReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (DepartmentReturnCodeEnum enume : DepartmentReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}